<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>组件使用class</h2>
      <!-- 在组件里面添加的class，会自动加到子组件的根元素上面 -->
      <tb-header class="font"></tb-header>
    </div>

    <script src="../Vue.js"></script>
    <script>
      Vue.component("TbHeader", {
        template: `
          <div>tbheader组件</div>
        `,
      });

      new Vue({
        el: "#app",
        data: {},
      });
    </script>
  </body>
</html>
